﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;

namespace WebUI.Pages
{
    public partial class editType : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                TypeController tpController = new TypeController();
                int idTipo = Convert.ToInt32(Request.QueryString["id"]);
                string TipoSolicitacao = tpController.GetRequestType(idTipo);

                lblID.Text = idTipo.ToString();
                txtNome.Text = TipoSolicitacao;
            }
        }

        protected void cmdSalvar_Click(object sender, EventArgs e)
        {
                TypeController tpController = new TypeController();
                tpController.UpdateType(Convert.ToInt32(lblID.Text), txtNome.Text);
                Response.Redirect("../Pages/mgrTypes.aspx");
        }
    }
}